The present invention relates to a music generator for generating a music which consists of at least a main melody, and more particularly relates to a method for storing the time and tone data of the music generator.
Heretofore, various hardware configurations for music generators have been developed in many parts of the world, but using an uneconomical method to store the tone and time data in the memory. As can be seen in FIG. 1, the conventional music generators comprise an oscillator 101, a tempo generator 102, two programmable counters 103 and 104, an address counter 105, a memory unit 106, a wave shaping circuit 107, an amplifier 108 and a transducer 109.
Time and tone data are stored in the memory unit 106, and control the tempo generator 102 and the programmable counters 103, 104. The tone data are stored in a plurality of bits in the memory unit 106 and are read out successively from each address in response to an address signal applied to the memory unit 106 by the address counter 105, which is controlled by the programmable counter 103 (i.e., the rhythm controller). The wave-shaping circuit converts the signals outputted from the programmable counter 104 and produces a waveform (for example, sinusoidal, rectangular or saw-toothed), and applies a selected modulating envelope to the outputted signal; for example, a decaying envelope. The shaped electronic signal wave form is amplified in the amplifier circuit 108 and the output of the amplifier 108 is converted to an acoustical output as a musical sound by the transducer 109.
The sequence (or method) for storing the time and tone data is illustrated in FIG. 2. Obviously, after storing the tempo data of a selected song, the time data are stored corresponding to respective tone data; i.e., taking each tone data with corresponding time data in the song as an unit. Each musical tone is controlled in its duration of the time data until the occurrence of the next musical tone in the same tone-producing circuit.
FIG. 3A shows a selected part of notes for a selected song. The data stored in the memory unit 106, wherein the eighth note is indicated by "0010" and the quarter note is indicated by "0001", are listed as follows:
______________________________________ Tempo data (for the selected song), 0010 (time data), 0001 (tone data), 1 0010 (time data), 0001 (tone data), 1 0010 (time data), 0101 (tone data), 5 0010 (time data), 0101 (tone data), 5 0010 (time data), 0110 (tone data), 6 0010 (time data), 0110 (tone data), 6 0001 (time data), 0101 (tone data), 5 and so on. ______________________________________
The number of bits for data storage in the memory unit is "14.times.8=112", in which the number of the notes is 14, and each note requires 8 bits to store the required data. Comprehensively, the memory space for storing the notes illustrated in FIG. 3B is equal to that for storing the notes in FIG. 3A, since the numbers of the notes therein are the same.
It should be noted that time data for duration of each musical tone data are read out of the memory unit 106 simultaneously with the tone data read-out which identifies the audio frequency of the musical note. The programmable counter 103 divides clock pulses supplied from the tempo generator 102. The division ratio of the programmable counter 103 is variable in response to the time or duration of the time data supplied from the memory unit 106.
A basic functional block diagram of another conventional music generator for dual tones is shown in FIG. 4, in which the technique involved therein is similar to that involved in the conventional music generator for a single tone. The block diagram of the conventional music generator for dual tones is similar to that of the music generator for single tone, but further provides a third programmable counter 104'. Similar to the programmable counter 104, the third programmable counter 104' is controlled by the memory unit 106 and is electrically connected to the wave shaping circuit 107. The programmable counters 104 and 104' respectively send signals to the wave shaping circuit 107 for the outputs of the main tones and the accompaniment tones.
The sequence (or method) for storing time and tone data is illustrated in FIG. 5. Obviously, after storing the tempo data of a selected song, a tie signal of two bits is stored and followed by respective main and accompaniment tone data of four bits, and the time data of four bits for the main and accompaniment tone data are then stored. It should be noted that the main tone is possibly accompanied by an accompaniment tone or two accompaniment tones. It is also possibly for there to be no accompaniment tone. The tie signal is provided to determine whether or not the main and accompaniment tones should be simultaneously played with regard to the time data. For example, as shown in FIG. 6, the third main tone in the second measure is accompanied by two accompaniment tones. In such a situation, the tie signal prevents the wave shaping circuit 107 from precharging the main tone when the accompaniment tone "Do" is played. Likewise, the first and second main tones in the fifth measure are only accompanied by an accompaniment tone, and the tie signal prevents the wave shaping circuit 107 not to precharging the accompaniment tone when the second main tone "So" is played.
The number of bits for data storage in the memory unit is "(2+4+4+4).times.30=420", in which the number of the tones is considered as 30, and each note requires 14 bits to store the required data.
The inconvenience in the above-mentioned method for storing the time and tone data is that when the adjacent tone data are the same, it is necessary to store the same time data, repeatedly. The present invention discloses another method for storing the rhythm and tone data to obviate the above-mentioned drawback.